﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Composition.Hosting;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace WordNet.Core
{
    public static class MEFLoader
    {
        public static CompositionContainer Load()
        {
            AggregateCatalog catalog = new AggregateCatalog();
            string directoryPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            DirectoryCatalog dirCatalog = new DirectoryCatalog(directoryPath, "*.dll");
            CompositionContainer container = new CompositionContainer(dirCatalog);
            return container;
        }
    }
}
